package com.finance.action.android.customer;

import java.util.Date;

import javax.annotation.Resource;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.common.vo.JsonVo;
import com.finance.entity.customer.JingdongConsumption;
import com.finance.service.customer.JingdongConsumptionService;

@Controller("JingdongConsumptionAction")
public class JingdongConsumptionAction {

	@Resource(name = "JingdongConsumptionService")
	private JingdongConsumptionService jingdongConsumptionService;
	
	/**
	 * 添加京东消费记录
	 * @param kfUserId 客户id
	 * @param goodsName 商品名
	 * @param consigneeAddr 收货地址
	 * @param orderDate 订单时间
	 * @param orderMoney 订单金额
	 * @param consigneePerson 收货人
	 * @param tel 电话
	 * @param orderStatus 订单状态
	 * @param payType 支付类型
	 * @return
	 */
	@ResponseBody
	@RequestMapping("addjingDong")
	public JsonVo<String> addjingDong(String kfUserId, String goodsName,
			String consigneeAddr, Date orderDate, Long orderMoney,
			String consigneePerson, String tel, String orderStatus,
			String payType) {
		JsonVo<String> json = new JsonVo<String>();
		JingdongConsumption jingdongConsumption = new JingdongConsumption();
		jingdongConsumption.setKfUserId(kfUserId);
		jingdongConsumption.setGoodsName(goodsName);
		jingdongConsumption.setConsigneeAddr(consigneeAddr);
		jingdongConsumption.setOrderDate(orderDate);
		jingdongConsumption.setOrderMoney(orderMoney);
		jingdongConsumption.setConsigneePerson(consigneePerson);
		jingdongConsumption.setTel(tel);
		jingdongConsumption.setOrderStatus(orderStatus);
		jingdongConsumption.setPayType(payType);
		jingdongConsumptionService.insert(jingdongConsumption);
		json.setCode(200);
		json.setMsg("成功");
		json.setSuccess(true);
		return json;
	}

}
